<div class="modal-header">
	<button class="close" data-dismiss="modal">x</button>
	<h4 class="modal-title">加入相册<strong>${gallery.title}</strong></h4>
</div>
<div class="modal-body">
	<form class="form-horizontal" action="/gallery/member/save/${gallery.id}" id="gallery-member-form">
		<div class="form-group">
			<div class="col-md-6 mb20-xs">
				<input class="form-control" type="text" placeholder="输入相册的密码，6位数字" 
					name="pwd" required minlength="6" maxlength="6">
			</div>
			<div class="col-md-2">
				<button class="btn btn-default btn-block" type="submit">
					<span class="glyphicon glyphicon-ok"></span>&nbsp;提交
				</button>
			</div>
		</div>
	</form>
</div>
<script>
$("#gallery-member-form").validate({
	rules : {
		"gallery.pwd" : {
			digits : true
		}
	},errorPlacement:function(){},
	submitHandler:function(form){
		$(form).find(":submit").button("loading");
		$(form).ajaxSubmit(function(json){
			$(form).find(":submit").button("reset");
			if(json.ok){
				location.reload();
			}else{
				alert(json.msg);
			}
			$(".modal").modal("hide");
		});
	}
	
});
</script>